import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopShippingMethodController } from '../../../controllers';
const uctoominishopShippingMethodRouter = new Router();
const minishopShippingMethodController = new uctooMinishopShippingMethodController();

uctoominishopShippingMethodRouter.post('/add', requireUser, minishopShippingMethodController.add);
uctoominishopShippingMethodRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_shipping_method'), minishopShippingMethodController.edit);
uctoominishopShippingMethodRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_shipping_method'), minishopShippingMethodController.delete);

//For getting minishopShippingMethod with permission control
uctoominishopShippingMethodRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_shipping_method'), minishopShippingMethodController.getSingle);
uctoominishopShippingMethodRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_shipping_method'), minishopShippingMethodController.getMany);
uctoominishopShippingMethodRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_shipping_method'), minishopShippingMethodController.getMany);

//#endregion AutoCreateCode
export default uctoominishopShippingMethodRouter;
